import request from '../../../src/utils/request.js'

export function listCamera(query) {
  return request({
    url: 'api/camera/list',
    method: 'get',
    params: query,
  })
}

export function addCamera(data) {
  return request({
    url: 'api/camera',
    method: 'post',
    data: data,
  })
}

export function updateCamera(data) {
  return request({
    url: 'api/camera',
    method: 'PUT',
    data: data,
  })
}

export function getCamera(id) {
  return request({
    url: 'api/camera/' + id,
    method: 'get'
  })
}

export function delCamera(pid) {
  return request({
    url: 'api/camera/delete/' + pid,
    method: 'delete'
  })
}

export function getCameraByDefenceAreaId(defenceAreaId) {
  return request({
    url: 'api/camera/dcamera/' + defenceAreaId,
    method: 'get'
  })
}